﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace hsgsSHXX.Web.common
{
    public class Show
    {
        /// <summary>
        /// 弹出框方法
        /// </summary>
        /// <param name="page">一般填this</param>
        /// <param name="message">要输出的内容</param>
        /// <param name="scripts">要在输出后增加的javascript语句，如window.close();...,如只需输出内容，就填""</param>
        public static void showMethod(System.Web.UI.Page page, string message, string scripts)
        {
            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), page.UniqueID, "alert('" + message + "');" + scripts, true);
        }

        /// <summary>
        /// 执行页面JS方法
        /// </summary>
        /// <param name="page">一般填this</param>
        /// <param name="methodName">方法名或具体内容，如："memu();"或"window.close();"</param>
        public static void MethodJs(System.Web.UI.Page page, string methodName)
        {
            System.Web.UI.ScriptManager.RegisterStartupScript(page, page.GetType(), page.UniqueID, methodName, true);
        }
    }
}
